<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="__THEMES__/style/common.css" />
       	<link rel="stylesheet" type="text/css" href="__THEMES__/style/admin_ui.css" />
       	<script type="text/javascript" src="__JS__/jQuery/jquery.js"></script>
       	<script type="text/javascript" src="__JS__/jQuery/plugin/troperate.js"></script>
		<script type="text/javascript" src="__JS__/jQuery/plugin/artDialog/jquery.artDialog.js?skin=aero"></script>
		<script type="text/javascript" src="http://mat1.gtimg.com/app/vt/public/openjs/latest.js"></script>
        <link href="__THEMES__/style/icons.css" rel="stylesheet" media="screen" type="text/css" />
        <script type="text/javascript">
        	T.init({
        		appkey : "{:C('QQ_APPKEY')}",
        		callbackurl : "{:C('WEB_DOMAIN')}/board.php"
        	});
        
            $(function(){
            	$('#send_broken').click(function(){
            		var broken = art.dialog({
            			title : $(this).text(),
            			lock : true,
            			content : '<input type="text" name="broken_content" class="input_text w480" /><p style="padding-top:4px;"><input type="checkbox" id="post_QQ" /> 同步到腾讯微博</p>',
            			ok : function(){
            				var content = $('input[name="broken_content"]').val();
            				
            				if (content == ''){
            					art.dialog({
            						content : '碎语内容不能为空！',
            						lock : true
            					});
            					return false;
            				}
            				
            				if ($('#post_QQ').attr("checked")){
            					if (T.loginStatus()){
            						
	            					T.api("/t/add",{content:content},"json","POST").success(function(back){
		            					if (back.msg == "ok"){
		            						art.dialog({
		            							title : '成功同步到腾讯微博',
	            								content : content + ' --- 成功同步到腾讯微博',
	            								lock : true
	            							});
		            					}
		            				});
            					}else{
            						T.login();
            						return false;
            					}
            				}
            				
            				$.post(
            					"{:U('broken/insert')}",
            					{ content : content, status : 'submit' },
            					function (eback){
            						if (eback.status == 1){
            							art.dialog({
            								content : content + '发布成功',
            								lock : true
            							});
            						}else{
            							
            						}
            					},
            					"json"
            				);
            			},
            			okVal : '发布碎语',
            			cancel : function(){
            				// --- 
            			}
            		});
            	});
            	
            });
        </script>
        <style type="text/css">
        	.icons_action a				{ color : #913f3f; }
        	.icons_action ul li:hover a	{ color : black; }
        </style>
		<title>{:C('ADMIN_TITLE')}</title>
	</head>
	<body>
		<include file="Public:header" />
        
        <div class="layout">
            
            <include file="Public:position" />
            
            <table class="warp" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <h2 id="welcome_title">Hi, {$_SESSION['loginUserID']}({$_SESSION['loginUserName']}).  Welcome to {:C('ADMIN_TITLE')}</h2>
                        
                        <div class="icons_action">
                        	<div id="dashboard-buttons" style="margin : 10px 10px 0px 10px;">
	                            <ul>
	                                <li><a href="javascript:void(0);" class="Clipboard_3 tooltip" id="send_broken" title="发布碎语">发布碎语</a></li>
	                                
	                                <li>
	                                    <a href="#" class="Star tooltip" title="Star">
	                                        Star
	                                    </a>
	                                    <div class="clear"></div>
	                                </li>
	                            </ul>
	                            <div class="clear"></div>
	                        </div>
                        </div>
                        
                        <div class="a_table" style="margin:10px;">
                        <table cellspacing="1" class="gr_list" width="100%">
                            <tr>
                                <th colspan="2" align="left" class="title">系统信息</th>
                            </tr>
                            <tr class="row_color" bgcolor="#f9f9f9">
                                <td width="12%" align="right" class="left_text">程序版本</td>
                                <td align="left"></td>
                            </tr>
                            <foreach name="info" item="v" mod="2">
                            <tr class="row_color" bgcolor="#f9f9f9">
                                <td width="12%" align="right" class="left_text">{$key}</td>
                                <td align="left">{$v}</td>
                            </tr>
                            </foreach>
                        </table>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        
        <include file="Public:footer" />
	</body>
</html>